package cn.catsdad.constant.enumConstant;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * auth模块枚举
 *
 * @author xuyonglong
 * @version V1.0 2023/4/12
 */
public class AuthEnum {

    /**
     * 性别
     */
    @Getter
    @AllArgsConstructor(access = AccessLevel.PRIVATE)
    public enum Gender {

        MAN("男", 1),
        WOMEN("女", 2);

        private final String name;
        private final Integer value;

        public static String getNameByValue(Integer value) {
            String result = "";
            if (value != null) {
                for (Gender gender : Gender.values()) {
                    if (value.equals(gender.value)) {
                        result = gender.name;
                        break;
                    }
                }
            }
            return result;
        }
    }

    /**
     * 菜单类型
     */
    @Getter
    @AllArgsConstructor(access = AccessLevel.PRIVATE)
    public enum MenuType {

        DIRECTORY("目录", 1),
        MENU("菜单", 2),
        BUTTON("按钮", 3);


        private final String name;
        private final Integer value;

        public static String getNameByValue(Integer value) {
            String result = "";
            if (value != null) {
                for (MenuType type : MenuType.values()) {
                    if (value.equals(type.value)) {
                        result = type.name;
                        break;
                    }
                }
            }
            return result;
        }

    }

    /**
     * 菜单显示状态
     */
    @Getter
    @AllArgsConstructor(access = AccessLevel.PRIVATE)
    public enum MenuShowStatus {

        SHOW("显示", 1),
        HIDE("隐藏", 2);

        private final String name;
        private final Integer value;

        public static String getNameByValue(Integer value) {
            String result = "";
            if (value != null) {
                for (MenuShowStatus showStatus : MenuShowStatus.values()) {
                    if (value.equals(showStatus.value)) {
                        result = showStatus.name;
                        break;
                    }
                }
            }
            return result;
        }

    }
}
